<?php
session_start(); // Initialize Session data
ob_start(); // Turn on output buffering

include "ewcfg7.php";
include "ewmysql7.php";
include "phpfn7.php";
include "../userfn.php";

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0

$currentObject=array();
//error_reporting(E_ALL);
//ini_set('display_errors', '1');

// Start timer
$GLOBALS["gsTimer"] = new cTimer();

// Open connection
$GLOBALS["conn"] = ew_Connect();
/*
 * IMPORTANT NOTE: This generated file contains only a subset of huge amount
 * of options that can be used with phpMyEdit. To get information about all
 * features offered by phpMyEdit, check official documentation. It is available
 * online and also for download on phpMyEdit project management page:
 *
 * http://platon.sk/projects/main_page.php?project_id=5
 *
 * This file was generated by:
 *
 *                    phpMyEdit version: 5.7.1
 *       phpMyEdit.class.php core class: 1.204
 *            phpMyEditSetup.php script: 1.50
 *              generating setup script: 1.50
 */

// MySQL host name, user name, password, database, and table

getPortalAppVars();
getAppLocales();


// User profile
$UserProfile = new cUserProfile();
$UserProfile->LoadProfile(@$_SESSION[EW_SESSION_USER_PROFILE]);

// Security
$Security = new cAdvancedSecurity();
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
if ($Security->IsLoggedIn()!=true && getParameter("action")!="login") {
	//$Security->SaveLastUrl();
	redirect("/butterflyportal/index.php?action=login");

}







if (getParameter("table")) setParameterInSession("table");
$tablename=getParameterFromSession("table");



if( TableExist($tablename)){

require_once 'phpMyEdit.class.php';


include 'phpMyEdit.init.php';

// Now important call to phpMyEdit

new phpMyEdit($opts);
}

else{
	


$folder=preg_split("/_/", $tablename)[0];
$file="system/".$folder."/".$tablename.".php";
	
if (file_exists($file)) include $file;


}

?>